import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import config from '@/config'

import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import './index.less';
import '@assets/iconfont/iconfont.css'
import '@assets/style/app.less'
// import "@babel/polyfill";
import 'core-js/stable'; 

Vue.use(ViewUI);


//全局常量
import constance from '@/libs/constance'
Vue.prototype.$constance = constance

// msg
import msg from '@/libs/msg-util'
Vue.prototype.$msg = msg

import pageHeader from '@/components/z-page-header/index'
Vue.component("zPageHeader", pageHeader)
import zTable from '@/components/z-table/index'
Vue.component("zTable", zTable)


//注册api
import api from '@/api/api';
Vue.prototype.$api = api
 

/**
 * @description 生产环境关掉提示
 */
Vue.config.productionTip = false
/**
 * @description 全局注册应用配置
 */
Vue.prototype.$config = config

new Vue({
  router,
  store,
  render: h => h(App),
  created(){
    // 更新窗口宽度
		this.$store.commit('updateBodySize', {
			width: document.body.clientWidth,
			height: document.body.clientHeight,
		});
		window.addEventListener('resize', () => {
			this.$store.commit('updateBodySize', {
				width: document.body.clientWidth,
				height: document.body.clientHeight,
			});
		});
  }
}).$mount("#app");
